from openpyxl import load_workbook

file_path = 'sum_average.xlsx'

wb = load_workbook(file_path)
ws = wb['Sheet1']

for i in range (2, 5):
    ws[f'D{i}'].value = f"=SUM(A{i}:C{i})"
    ws[f'E{i}'].value = f"=AVERAGE(A{i}:C{i})"
    ws[f'F{i}'].value = f'=IF(AND(A{i}>3,B{i}>3,C{i}>3),"BIG","SMALL")'

wb.save(file_path)

# ws['D2'].value = "=SUM(A2:C2)"
# ws['D3'].value = "=SUM(A3:C3)"
# ws['D4'].value = "=SUM(A4:C4)"
#
# ws['E2'].value = "=AVERAGE(A2:C2)"
# ws['E3'].value = "=AVERAGE(A3:C3)"
# ws['E4'].value = "=AVERAGE(A4:C4)"





